<?php 
$request = system_controller_front::getInstance()->getRequest();
$controller = $request->getControllerName();
$defaultKeyword = (string) $this->language(picture_front_controller::$keyword);
$keyWords = $this->escape(trim($request->getQuery('keyword')));
if($keyWords == '') $keyWords = $defaultKeyword;
?><!DOCTYPE html>
<html>
<head>
<title><?php echo $this->headTitle();?>::<?php echo $this->setting('title');?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<?php echo $this->setting('keywords');?>" />
<meta name="description" content="<?php echo $this->setting('description');?>" />
<script type="text/javascript" src="<?php echo $this->baseUrl(_STATIC_HTTP . '/jquery/jquery-1.7.min.js');?>"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl(_STATIC_HTTP . '/www/js/main.js');?>"></script>
<link href="<?php echo $this->baseUrl(_STATIC_HTTP . '/www/css/index.css');?>" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="<?php echo $this->baseUrl('/favicon.ico');?>"/>
<?php echo $this->headLink() . $this->headStyle() . "\n" . $this->headScript() . "\n";?>
</head>
<body>
<div class="minwidth" id="header">
	<form action="<?php echo $this->url('search/index');?>" method="get">
	<div class="logo"><a href="<?php echo $this->url('index/index');?>" title="<?php echo $this->setting('title');?>"><?php echo $this->setting('title');?></a></div>
	<div class="hdr">
		<div class="hdrwarp">
			<div class="navigate">
				<ul class="category">
					<li<?php if($controller == 'index') {?> class="current"<?php } ?>><a href="<?php echo $this->url('index/index');?>"><?php echo $this->language('首页');?></a></li>
					<?php foreach($this->navigateCategoryList AS $category) { ?>
					<li<?php if($controller == 'category' && $request->getParam('name') == $category['name']) {?> class="current"<?php } ?>><a href="<?php echo $this->url('category/index', array('name' => $category['name'], 'page' => '1'));?>"><?php echo $this->escape($category['title']);?></a></li>
					<?php } ?>
				</ul>
			</div>
			<div class="search">
				<span class="input"><input type="text" name="keyword" value="<?php echo $keyWords;?>"<?php if(strtolower($keyWords) == strtolower($defaultKeyword)){echo ' class="gray" ';}?> onfocus="if(this.value=='<?php echo $defaultKeyword;?>'){this.value='';this.className='';}" onblur="if(this.value==''){this.value='<?php echo $defaultKeyword;?>';this.className='gray';}"/></span>
				<span class="button"><button name="f" type="submit" value="hihiGirl" class="small"><?php echo $this->language('搜索');?></button></span>
			</div>
			<div class="hmask"></div>
		</div>
	</div>
	</form>
</div>
<div class="minwidth" id="tags">
	<ul>
		<?php foreach($this->navigateKeywordList AS $keyword) { ?>
		<li><a href="<?php echo $this->url('search/keyword', array('name' => $keyword['name'], 'page' => '1'));?>"><?php echo $this->escape($keyword['name']);?></a></li>
		<?php } ?>
	</ul>
</div>
<div class="body minwidth">
	<div class="main">
		<?php
			echo $this->content . "\n";
			echo $this->render('include/debug.phtml');
		?>
	</div>
	<div class="clear"></div>
</div>
<div class="minwidth" id="footer"></div>
<div id="mask"></div>
<div class="imgcache"><img class="bgcache" src="<?php echo $this->baseUrl(_STATIC_HTTP . '/www/img/bg.png');?>" <?php echo 'res="' . $this->url('index/autoBackground', array(), array('p' => http_build_query($request->getParams()))) . '"';?>/></div>
</body>
</html>
